import request from "@/utils/request";

// 查询生产计划列表
export function listPlan(query) {
  return request({
    url: "/prod/plan/list",
    method: "get",
    params: query,
  });
}

// 查询生产计划详细
export function getPlan(planId) {
  return request({
    url: "/prod/plan/" + planId,
    method: "get",
  });
}

//根据生产计划id获取工艺
export function getGy(planId) {
  return request({
    url: "/prod/plan/getGy/" + planId,
    method: "get",
  });
}

// 新增生产计划
export function addPlan(data) {
  return request({
    url: "/prod/plan",
    method: "post",
    data: data,
  });
}

// 修改生产计划
export function updatePlan(data) {
  return request({
    url: "/prod/plan",
    method: "put",
    data: data,
  });
}

// 删除生产计划
export function delPlan(planId) {
  return request({
    url: "/prod/plan/" + planId,
    method: "delete",
  });
}

// 导出生产计划
export function exportPlan(query) {
  return request({
    url: "/prod/plan/export",
    method: "get",
    params: query,
  });
}

// 拆分生产计划
export function separatePlan(data) {
  return request({
    url: "/prod/plan/createProd",
    method: "post",
    data: data,
  });
}

// 物料下拉
export function listMaterial(query) {
  return request({
    url: "/base/material/getList",
    method: "get",
    params: query,
  });
}

// 产线下拉
export function listMaterial22(query) {
  return request({
    url: "/base/material/getList",
    method: "get",
    params: query,
  });
}

// 产品下拉
export function listProduct(query) {
  return request({
    url: "/set/model/interface",
    method: "get",
    params: query,
  });
}

// 工艺路线下拉
export function listOperations(query) {
  return request({
    url: "/base/operations/getList",
    method: "get",
    params: query,
  });
}

// 客户下拉
export function listCustomer(query) {
  return request({
    url: "/base/customer/getList",
    method: "get",
    params: query,
  });
}
